#!/bin/bash
# Scriptname: trapping
# Script to illustrate the trap command and signals
# Can use the signal numbers or bash abbreviations seen
# below. Cannot use SIGINT, SIGQUIT, etc.

trap 'echo "Control-C will not terminate $0."'  INT
trap 'echo "Control-\\ will not terminate $0."'  QUIT
trap 'echo "Control-Z will not terminate $0."'  TSTP
echo  "Enter any string after the prompt.
When you are ready to exit, type \"stop\"."
while true
do
	echo -n "Go ahead...> "
	read
	if [[ $REPLY == [Ss]top ]]
	then 
		break
	fi
done
